package com.rong.creatmodel.buildermodel.buildhouse;

// 指挥者 ：指定建造顺序，并且负责启动建造过程
public class HouseDirector {

    HouseBuilder builder = null;

    // 构造器传入建造者

    public HouseDirector(HouseBuilder builder) {
        this.builder = builder;
    }
    // setter传入建造者
    public void setBuilder(HouseBuilder builder) {
        this.builder = builder;
    }

    // 如何处理建造房子的流程 交给指挥者
    public House constructHouse(){
        builder.buildBasic();
        builder.buildWalls();
        builder.roofed();
        return builder.buildHouse();
    }
}
